﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IdeaNMR.Shared
{
    public interface IExperimentBuilder
    {
        string SpectrometerScript { get; set; }
        string SampleScript { get; set; }
        string PulseProgramScript { get; set; }
        string PulseProgramContent { get; set; }
       
        int ComponentsNumber { get; }

        Dictionary<string, ComponentItem> Components { get; }

        LogBook<string> Log { get; }

        string CreateExperimentScript(string name, string username);
    }

    [Serializable]
    public class ComponentItem
    {
        public Guid Id { get; set; }
        public ComponentType Type { get; set; }
        public string Identifier { get; set; }
        public string Name { get; set; }
        public string Content { get; set; }
        public string Script { get; set; }
        public bool IsIncludable { get; set; }

        public override int GetHashCode()
        {
            return this.Id.GetHashCode();
        }
    }

    /// <summary>
    /// Component type.
    /// </summary>
    /// <remarks>When changed check the extension methods.</remarks>
    public enum ComponentType : int
    {
        PulseProgram = 0,
        WaveShape = 1,
        Cpd = 2,
        Script = 3
    }

    public enum HardObjectType : int
    {
        Sample = 0,
        Spectrometer
    }
}